package com.icid.store.util
{
	import mx.logging.ILogger;
	import mx.logging.Log;
	import mx.logging.LogEventLevel;
	import mx.logging.targets.TraceTarget;
	
	public class LogHelper
	{		
		private static var LOGLEVEL:int = LogEventLevel.INFO;
		
		private static var logTarget:TraceTarget = new TraceTarget();
		private static var myLogger : ILogger;
		
		{
			logTarget.filters=["icid"];
			
			// Log all log levels.
			logTarget.level = LOGLEVEL;
			
			logTarget.includeTime = true;
			
			// Begin logging.
			Log.addTarget(logTarget);
			
			myLogger = Log.getLogger("icid");
		
		}		
		
		public static function setLogLevel(level:int):void
		{
			LOGLEVEL = level;
			
			logTarget.level = LOGLEVEL;
		}
		
		public static function debug(message:*):void
		{
			myLogger.debug(String(message));
		}
		
		public static function info(message:*):void
		{
			myLogger.info(String(message));
		}
		
		public static function warn(message:*):void
		{
			myLogger.warn(String(message));	
		}
		
		public static function error(message:*):void
		{
			myLogger.error(String(message));	
		}

	}
}